Repository navigation
Studio: npm run check runs the real git, past macOS's xcrun stub (#803) - #817
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #803. Leaves it open: it stays the log for later loads.
Summary
On this Mac,
/usr/bin/gitis first onPATH, and it is a stub that runsxcrunon every call to find Xcode'sgit. A check's tests make about 18,000gitcalls, and those calls were 78% of the test run's CPU (measurements in #803).npm run checknow hands its steps aPATHwith the realgitahead of the stub.It goes right before
/usr/bin, not at the front, so every folder before/usr/bin(node_modules/.bin, a test's fakebin) keeps its place. Xcode's folder holds 115 other tools. Those also pass over only/usr/bin's stubs, which run the same tools.Documented in
docs/studio/development.md, in the check-slot paragraph.Evidence
ui/tests/check-slot.test.mjs, the new tablethe wrapped command's git, with <kind> first on PATH. Its rowPATH=<dir>:/usr/bin:/binexpects<xcrun -f git> <dir>, and before the change it failed:PATH. The row's second field (the first folder must stay<dir>) catches that version too.After: both rows pass: the stub row, and a fake
gitbefore the stub, which stays first.npm run checkis green: 2,007 Rust tests and 847 node tests, 1 skipped (an existing skip, not these rows).git rev-parse, 200 calls, CPU viawait4):/usr/bin/git6.4-7.4 ms, Xcode'sgit2.3 ms.studio-system-map::it, A/B with Xcode'sgitfirst onPATH: CPU 130 → 85 s and 101 → 71 s; wall 49 → 26 s and 30 → 20 s. The Mac was loaded (load 10-19) and these are two pairs, so treat them as about 30%, not as exact figures.Merge Danger
Door: two-way
A revert of one file puts
PATHback.Blast Radius: checks
Only
npm run checkon macOS changes, and only when/usr/bin/gitwould be found first. The steps then run Xcode'sgit(and Xcode's other tools in place of their/usr/binstubs), the same binaries the stubs run, withoutxcrunin front.npm run check:steps, directcargo nextestruns and the plotkeeper server's owngitcalls are unchanged and still go through the stub. The bigger cut, fewer temporarygitrepos per test case (#803, fix direction 1), is not in this PR.Correctness pass
Not run: the PR changes JavaScript (
.mjs) and Markdown, no Rust or TypeScript.Outside review
skipped: no risk match
🤖 Generated with Claude Code